﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin_PermP_List.aspx.cs" Inherits="Web.Base.admin_PermP_List" %>

<%@ Register assembly="Control" namespace="Com.Control" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>管理角色列表</title>
  <link href="css/Page.css" rel="stylesheet" type="text/css" />
    
<script type="text/javascript" src="../../js/jquery.js"></script> 
<script type="text/javascript">


    function doDel(id) {

        $.ajax({
            type: "POST",
            url: "admin_Perm_Del.aspx",
            dataType: "html",
            data: "role_id=" + id,
            timeout: 30000,
            success: function(data) {

                alert("删除成功!");
                window.location.reload();
            },
            error: function(xmlHttpRequest, error) {
                alert("此角色不存在,删除失败!");
                window.location.reload();
            }

        });

    }
</script>

    
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="border:1px solid #9abddd;" border="0" cellpadding="0" cellspacing="0" width="98%">
            <tr>
                <td colspan="2" class="TitleBar"  align="center">
                    管理角色管理
                </td>
            </tr>
            
            <tr>
                <td class="Pager" colspan="2" align="right">
                    <asp:Button style="margin-right:10px" ID="btAdd" runat="server" Text="添加角色" 
                        onclick="btAdd_Click" />
                </td>
            </tr>   
                   
            <tr>
                <td class="MenuItem" align="center">角色名称</td>
                <td class="MenuItem" align="center">操作</td>
             
            </tr>  
            <asp:Repeater ID="repeater" runat="server">
		        <ItemTemplate>         
                      <tr style='background-color:<%#(Container.ItemIndex%2==0)?"write":"#f5f5f5;"%>'>
                        <td class="RecordItem" align="center">&nbsp;<%#Eval("Name") %></td>
                        <td class="RecordItem" align="center">&nbsp;
                        <a class="Link" href="admin_Perm_List.aspx?id=<%#Eval("id") %>" >修改权限</a>
                       &nbsp;&nbsp;&nbsp;&nbsp; <a class="Link" onclick="if( window.confirm('确实删除?') == false ) return false;else {doDel(<%#Eval("id") %>);}" href="#">删除</a>
                        </td>
                     </tr> 
                </ItemTemplate>
			</asp:Repeater>                                                               
            <tr>
                <td class="Pager" colspan="2" align="center">
                    <cc1:MyPageBar ID="MyPageBar1" runat="server" />
                </td>
            </tr>                                
        </table>
    </div>
    </form>
</body>
</html>
  